var debug = require('debug')('mynode');
var app = require('./app');
var config = require('./config');

app.set('port', config.port || 18080);

var server ;
if(config.host)
    server = app.listen(app.get('port'), function(){
	debug('Express server listening on port ' + server.address().port);
    });
else
{
    app.set('host', config.host);
    server = app.listen(app.get('port'), app.get('host'), function(){
	debug('Express server listening on port ' + server.address().port);
    });
}
